<!--#INCLUDE FILE="config.asp"-->
<%
 if(Session("SalesAccessLevel") <> 1 and Session("SalesAccessLevel") <> 4 and Session("CostabajaAccessLevel") <> 2 and Session("CostabajaAccessLevel") <> 3) then
	Response.Redirect("default.asp?msg=invalid")
end if

 'Endcrypt information of CC
Set objEncrypter = Server.CreateObject("Hyeongryeol.StringEncrypter")
objEncrypter.Key = edCode
objEncrypter.InitialVector = conIV
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- DATE PICKER SCRIPT -->
<link type="text/css" href="../css/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript">
	// ***** Session Timeout Warning and Redirect mReschke 2010-09-29 ***** //
function InitSessionTimer() {
    /* mReschke 2010-09-29 */
    warn_sec = <%=session.timeout%> * 60 * 1000;   	//Warning time in milliseconds
    timeout_sec = <%=session.timeout%> * 60 * 1000 + 60000;          //Actual timeout in milliseconds
    show_warning = true;
    epoch = new Date().getTime();
    CheckSessionStatus();
}
InitSessionTimer();
function CheckSessionStatus() {
    /* mReschke 2010-09-29 */
 
    //Check for session warning
    epoch2 = new Date().getTime();
     if (epoch2 > epoch + timeout_sec) {
        alert("Your session has timed out.");
        window.location.href = 'default.asp?msg=invalid_out';
    } else {
        down = setTimeout("CheckSessionStatus();", 2000);
    }
}
</script>
<script>
	$(function() {
		$( "#arrival1" ).datepicker();
		$( "#departure1" ).datepicker();
		$( "#arrival2" ).datepicker();
		$( "#departure2" ).datepicker();
		$("#Date_VisitCalendar").datepicker();
	});
	</script>
  <!-- END DATE PICKER SCRIPT  ss-->
  
  <script> 
  $(document).ready(function(){
  $('ul.guest_timeline_list li:nth-child(odd)').addClass('alternate');
});
</script>

<style>
#divA,
#divB,
#divC,
#divD


{	
	display:none;
	
}	
.guest_timeline_list {
	height: 165px;
	overflow:scroll;
}
</style>

<!-- demo only -->

<script language="javascript"> 
function toggle() {
	var ele = document.getElementById("divA");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "+ Reservacion additional / Aditional Reservation";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "- Reservacion additional / Aditional Reservation";
	}
} 
</script>

<!-- end demo only -->


<script>
function SubmitForm()
{


	document.forms['prospect_edit'].action='sales-prospect-profile-page-process.asp';
	document.forms['prospect_edit'].submit();
}

</script>

<title>Perfil de Huésped Sales :: CostaBaja</title>
<%

if(request("pID") <> "") then
		prospectID = request("pID")
	else 
		prospectID = 0
	end if
	
	sqlstring2 = "SELECT TOP 1 CreditcardID, TransportID FROM Guests WHERE Guests.GuestID ="& prospectID
	
	set objConnect1 = server.createObject("ADODB.Connection")   

	objConnect1.Open conStr

	set TblTemp1 = server.createobject("Adodb.Recordset")
		
		TblTemp1.Open sqlstring2, objConnect1
		
	If not TblTemp1.EOF Then
		CreditcardID = TblTemp1("CreditcardID")
		TransportID = TblTemp1("TransportID")
	end if 
	
	
	dim count
	
	dim travelsAreals, strItem
	
	SET travelsAreals = CreateObject("Scripting.Dictionary")
	
	count = 0
	
	sqlstring = ""
	sqlstring = sqlstring & "SELECT DISTINCT Guests.*, Travels.*, Transports.*, VisitCalendar.*,Codes.*,Codes.ExpDate As expiredDate, Reservation.Location "
	sqlstring = sqlstring & "FROM Guests "
	sqlstring = sqlstring & "LEFT JOIN Guests_Travels on Guests.GuestID = Guests_Travels.GuestID "
	sqlstring = sqlstring & "LEFT JOIN Travels on Guests_Travels.TravelID = Travels.TravelID "
	sqlstring = sqlstring & "LEFT JOIN Reservation on Reservation.TravelId = Travels.TravelID "
	sqlstring = sqlstring & "LEFT JOIN Codes on Travels.CodeID = Codes.CodeID "
	sqlstring = sqlstring & "LEFT JOIN VisitCalendar on VisitCalendar.GuestID = Guests_Travels.GuestID "
	sqlstring = sqlstring & "LEFT JOIN Transports on Guests.TransportID = Transports.TransportID "
	sqlstring = sqlstring & "WHERE Guests.GuestID ="& prospectID
	
	sqlstring1 = ""
	sqlstring1 = sqlstring1 & "SELECT DISTINCT Guests.*, Travels.*, Transports.*, VisitCalendar.*, Codes.*,Codes.ExpDate As expiredDate, Creditcards.*, Reservation.Location "
	sqlstring1 = sqlstring1 & "FROM Guests "
	sqlstring1 = sqlstring1 & "LEFT JOIN Guests_Travels on Guests.GuestID = Guests_Travels.GuestID "
	sqlstring1 = sqlstring1 & "LEFT JOIN Travels on Guests_Travels.TravelID = Travels.TravelID "
	sqlstring1 = sqlstring1 & "LEFT JOIN Reservation on Reservation.TravelId = Travels.TravelID "
	sqlstring1 = sqlstring1 & "LEFT JOIN Codes on Travels.CodeID = Codes.CodeID "
	sqlstring1 = sqlstring1 & "LEFT JOIN VisitCalendar on VisitCalendar.GuestID = Guests_Travels.GuestID "
	sqlstring1 = sqlstring1 & "LEFT JOIN Transports on Guests.TransportID = Transports.TransportID "
	sqlstring1 = sqlstring1 & "LEFT JOIN Creditcards on Guests.CreditcardID = Creditcards.CreditcardID "
	sqlstring1 = sqlstring1 & "WHERE Guests.GuestID ="& prospectID
	
	sqlstring2 = ""
	sqlstring2 = sqlstring2 & "SELECT DISTINCT Guests.*, Travels.*, VisitCalendar.*, Codes.*,Codes.ExpDate As expiredDate , Reservation.Location "
	sqlstring2 = sqlstring2 & "FROM Guests "
	sqlstring2 = sqlstring2 & "LEFT JOIN Guests_Travels on Guests.GuestID = Guests_Travels.GuestID "
	sqlstring2 = sqlstring2 & "LEFT JOIN Travels on Guests_Travels.TravelID = Travels.TravelID "
	sqlstring2 = sqlstring2 & "LEFT JOIN Reservation on Reservation.TravelId = Travels.TravelID "
	sqlstring2 = sqlstring2 & "LEFT JOIN VisitCalendar on VisitCalendar.GuestID = Guests_Travels.GuestID "
	sqlstring2 = sqlstring2 & "LEFT JOIN Codes on Travels.CodeID = Codes.CodeID "
	sqlstring2 = sqlstring2 & "WHERE Guests.GuestID ="& prospectID
	
	sqlstring3 = ""
	sqlstring3 = sqlstring3 & "SELECT DISTINCT Guests.*, Travels.*, VisitCalendar.*, Codes.*,Codes.ExpDate As expiredDate, Creditcards.* , Reservation.Location "
	sqlstring3 = sqlstring3 & "FROM Guests "
	sqlstring3 = sqlstring3 & "LEFT JOIN Guests_Travels on Guests.GuestID = Guests_Travels.GuestID "
	sqlstring3 = sqlstring3 & "LEFT JOIN Travels on Guests_Travels.TravelID = Travels.TravelID "
	sqlstring3 = sqlstring3 & "LEFT JOIN Reservation on Reservation.TravelId = Travels.TravelID "
	sqlstring3 = sqlstring3 & "LEFT JOIN Codes on Travels.CodeID = Codes.CodeID "
	sqlstring3 = sqlstring3 & "LEFT JOIN VisitCalendar on VisitCalendar.GuestID = Guests_Travels.GuestID "
	sqlstring3 = sqlstring3 & "LEFT JOIN Creditcards on Guests.CreditcardID = Creditcards.CreditcardID "
	sqlstring3 = sqlstring3 & "WHERE Guests.GuestID ="& prospectID
	
	set objConnect = server.createObject("ADODB.Connection")   

	objConnect.Open conStr

	set TblTemp = server.createobject("Adodb.Recordset")
		
	if (IsNull(CreditcardID) AND IsNull(TransportID) = False) then
		TblTemp.Open Sqlstring, objConnect
	end if
	if (IsNull(TransportID) AND IsNull(CreditcardID) = False) then
		TblTemp.Open sqlstring3, objConnect
	end if
	if (IsNull(TransportID) AND IsNull(CreditcardID)) then
		TblTemp.Open sqlstring2, objConnect
	end if
	if (IsNull(TransportID) = False AND IsNull(CreditcardID) = False) then
		TblTemp.Open sqlstring1, objConnect
	end if

	
	Do Until TblTemp.EOF
	count = count + 1
		Title = TblTemp("Title")
		Name = TblTemp("Name")
		Middle = TblTemp("Middle")
		Surname = TblTemp("Surname")
		Phone = TblTemp("Phone")
		Email = TblTemp("Email")
		LanguageID = TblTemp("LanguageID")
		Address1 = TblTemp("Address1")
		Address2 = TblTemp("Address2")
		City = TblTemp("City")
		Province = TblTemp("Province")
		ZipCode = TblTemp("Zip")
		Country = TblTemp("Country")
		Communication = TblTemp("Communication")
		CreditcardID = TblTemp("CreditcardID")
		TransportID = TblTemp("TransportID")
		MaritalStatus = TblTemp("MaritalStatus")
		OwnABoat = TblTemp("OwnABoat")
		Feet = TblTemp("Feet")
		PlayGolf = TblTemp("PlayGolf")
		InvestmentRange = TblTemp("InvestmentRange")
		Occupation = TblTemp("Occupation")
		KindOfInvestment = TblTemp("KindOfInvestment")
		AnnualIncome = TblTemp("AnnualIncome")	
		Source = TblTemp("Source")
		SalesId = TblTemp("SaleID")
		
		Code = TblTemp("Code")
		codeID = TblTemp("CodeID")
		TotalNumberGuests = TblTemp("TotalNumberGuests")
		NumberChildren = TblTemp("NumberChildren")
		NamesChaperone = TblTemp("NamesChaperone")
		ExtraNight = TblTemp("ExtraNight")
		RoomDetail = TblTemp("RoomDetail")
		ActivitesOnTravels = TblTemp("ActivitesOnTravels")
		Campaign = TblTemp("Campaign")
		Originator = TblTemp("Originator")
		ProductID = TblTemp("ProductID")
		Travelid = TblTemp("TravelID")
		
		Propertis = TblTemp("Property")
		Interes = TblTemp("Interes")
		Giveaways = TblTemp("Giveaways")
		Datetime = TblTemp("Datetime")
		Hora_time = TblTemp("Hora_time")
		
		' Add to dictionary
		travelsAreals.Add ""&count, Array(Originator,ProductID,Campaign,TotalNumberGuests,NumberChildren,ExtraNight,NamesChaperone,RoomDetail,ActivitesOnTravels,Travelid,codeID,Code)
				
		if (IsNull(TransportID) = False) then
			ArrivalAirlineID = TblTemp("ArrivalAirlineID")
			ArrivalAirportID = TblTemp("ArrivalAirportID")
			ArrivalNeedTransport = TblTemp("ArrivalNeedTransport")
			ApproximateArrivalTime = TblTemp("ApproximateArrivalTime")
			DepartureAirlineID = TblTemp("DepartureAirlineID")
			DepartureAirportID = TblTemp("DepartureAirportID")
			DepartureNeedTransport = TblTemp("DepartureNeedTransport")
			DepartureTime = TblTemp("DepartureTime")
			Note = TblTemp("Notes")
			InformationPending = TblTemp("InformationPending")
		end if
		
		if (IsNull(CreditcardID) = False) then
			nameCard = objEncrypter.Decrypt(TblTemp("NameCard"))
			typeCard = objEncrypter.Decrypt(TblTemp("TypeCard"))
			if (Session("SalesAccessLevel") = 4) then
				cardNumber = objEncrypter.Decrypt(TblTemp("CardNumber"))
			else
				cardNumber = "XXXXXXX" & Right(objEncrypter.Decrypt(TblTemp("CardNumber")),4)
			end if
			
			expDate = TblTemp("ExpDate")
			securityCode = objEncrypter.Decrypt(TblTemp("SecurityCode"))
			
			Address1_CC = TblTemp("Address1_CC")
			Address2_CC = TblTemp("Address2_CC")
			City_CC = TblTemp("City_CC")
			Country_CC = TblTemp("Country_CC")
			ZipCode_CC = TblTemp("ZipCode_CC")
			Province_CC = TblTemp("Province_CC")

		end if
	TblTemp.MoveNext
	Loop

%>
</head>
<script type="text/javascript"> 
	var valueChecks = '';
	var timeVisit = "";
	
	$(document).ready(function(){
	
	if ($('#addNotes'))
		$('#addNotes').click(function(){
			$.ajax({
				type:"POST",
				url: "add_Notes.asp",
				dataType: "html",
				data: {title:$("#Titulo").val(), note:$("#Nota").val(), guestid:$("#guestID").val()},
				async: false,
				success: function(data){ 
					location.reload();
				}
			});
			return false;
		});
		
		$('.linkHistory').unbind();
		$('.linkHistory').click(function(ev) { 
			var buttonId = $(this).attr('id');
			var name = $(this).attr('name');

			var guestId = $("#guestID").val();
			window.open('HistoryDetail.asp?historyName='+buttonId+'&guestId='+guestId,'History Detail','width=800,height=600,location=0');

			ev.preventDefault();
			return false;
		});
		
	// Init selected value for dropdown
	InitDropDown();
	
	// Init default value for State dropdown
	<% if (Country = "3" or Country = "4" or Country = "7" or Country = "8" or Country = "9" or Country = "11" or Country = "14") then %>
		$("#State").attr("disabled", true);
		$("#Pais").val('<%=Country%>');
		$("#country").val('<%=Country%>');
		$("#province").val('<%=Province%>');
		$("#td_province").removeAttr("style");
	
	<%elseif (Country <> "3" AND Country <> "4" AND Country <> "7" AND Country <> "8" AND Country <> "9" AND Country <> "11" AND Country <> "14") then%>
		
		$("#Pais").val('<%=Country%>');
		LoadState();
		$("#State").val('<%=Province%>');
		$("#province").val('<%=Province%>');
		$("#country").val('<%=Country%>');
	<%else %>
		LoadState();
	<%end if%>
	
	<% if (Country_CC = "3" or Country_CC = "4" or Country_CC = "7" or Country_CC = "8" or Country_CC = "9" or Country_CC = "11" or Country_CC = "14") then %>
		$("#State_billing").attr("disabled", true);
		$("#Pais_billing").val('<%=Country_CC%>');
		$("#country_billing").val('<%=Country_CC%>');
		$("#province_billing").val('<%=Province_CC%>');
		$("#td_province_billing").removeAttr("style");
	
		
	<%elseif (Country_CC <> "3" AND Country_CC <> "4" AND Country_CC <> "7" AND Country_CC <> "8" AND Country_CC <> "9" AND Country_CC <> "11" AND Country_CC <> "14") then%>		
		
		$("#Pais_billing").val('<%=Country_CC%>');
		LoadState_Billing();
		$("#State_billing").val('<%=Province_CC%>');
		$("#province_billing").val('<%=Province_CC%>');
		$("#country_billing").val('<%=Country_CC%>');
	<%else%>
		LoadState_Billing();
	<%end if%>
	
	
	/*
	*	Event when changing Pais's dropdown 
	*/
	$("#Pais").change(function(){
		LoadState();
	});
	
	$("#State").change(function(){
			$("#province").val($("#State").val());
		});
	
	$("#Pais_billing").change(function(){
		LoadState_Billing();
	});
	
	// Update State to textbox
		$("#State_billing").change(function(){
			$("#province_billing").val($("#State_billing").val());
		});
	/*
	*	END 
	*/
	
	// Update State to textbox
	$("#State").change(function(){
		$("#province").val($("#State").val());
	});
	
	$("#State_billing").change(function(){
		$("#province_billing").val($("#State_billing").val());
	});
		
	// check "same as above" checkbox
		$('#addAdress').bind('change', function () {
			if ($(this).is(':checked')) {
				var address1 = $('#Address1').val();
				var address2 = $('#Address2').val();
				var city = $('#City').val();
				var postal = $('#Zip').val();
				
				$("#Direccion1_billing").val(address1);
				$("#Direccion2_billing").val(address2);
				$("#Ciudad_billing").val(city);
				$("#Postal_billing").val(postal);
				
				if ($("#Pais").val() == 3 || $("#Pais").val() == 4 || $("#Pais").val() == 7 || $("#Pais").val() == 8 || $("#Pais").val() == 9 || $("#Pais").val() ==11 || $("#Pais").val() == 14 ) {
					$("#State_billing").attr("disabled", true);
					$("#Pais_billing").val($("#Pais").val());
					$("#country_billing").val($("#country").val());
					$("#province_billing").val($("#province").val());
					$("#td_province_billing").removeAttr("style");
				} else {
					$("#Pais_billing").val($("#Pais").val());
					LoadState_Billing();
					$("#State_billing").val($("#State").val());
					$("#country_billing").val($("#country").val());
					$("#province_billing").val($("#province").val());
				}
			} else {
				$("#State_billing").attr("disabled", false);
				$("#Direccion1_billing").val('');
				$("#Direccion2_billing").val('');
				$("#Ciudad_billing").val('');
				$("#Postal_billing").val('');
				$("#State_billing").val('select');
				$("#Pais_billing").val('USA');
				$("#country_billing").val('');
				$("#province_billing").val('');
				$("#td_pais_billing").css("display","none");
				$("#td_province_billing").css("display","none");
			}
		});
	
	// set value to profile

	});

	function LoadState(){
		$.ajax({
			type:"POST",
			url: "updateDropdownList.asp",
			dataType: "html",
			data: {CountryID:$("#Pais").val()},
			async: false,
			success: function(data){
				if (data != "")
				{
					$("#State").html(data);
					$("#State").attr("disabled", false);
					$("#td_pais").css("display","none");
					$("#td_province").css("display","none");
					$("#country").val($("#Pais").val());
				}	
				else {
					$("#State").attr("disabled", true);
					$("#country").val($("#Pais").val());
					$("#province").val('');
					$("#td_province").removeAttr("style");
				}
			}
			});
		return false;
	}
	
	function LoadState_Billing(){
		$.ajax({
			type:"POST",
			url: "updateDropdownList.asp",
			dataType: "html",
			data: {CountryID:$("#Pais_billing").val()},
			async: false,
			success: function(data){
				if (data != ""){
					$("#State_billing").html(data);
					$("#State_billing").attr("disabled", false);
					$("#td_pais_billing").css("display","none");
					$("#td_province_billing").css("display","none");
					$("#country_billing").val($("#Pais_billing").val());
				}	
				else {
					$("#State_billing").attr("disabled", true);
					$("#country_billing").val($("#Pais_billing").val());
					$("#province_billing").val('');
					$("#td_province_billing").removeAttr("style");
				}
			}
			});
		return false;
	}
	
	function InitDropDown(){
		$("#language").val('<%=LanguageID%>');
		$("#Communication").val('<%=Communication%>');
		$("#Source").val('<%=Source%>');
		$("#Hora_Time").val('<%=Hora_time%>');
		$("#Product").val('<%=Product%>');
		$("#Extra_Guests").val('<%=ExtraGuests%>');
		$("#Kids").val('<%=Kids%>');
		$("#Extra_Nights").val('<%=ExtraNights%>');
	}
</script>

<script language="javascript">
var n = 0;
var x = 0;
x = 4 - parseInt(<%=count%>);

    function divHideShow(divToHideOrShow) 
    {
        var div = document.getElementById(divToHideOrShow);
		var text = document.getElementById("displayText");
        if (div.style.display == "block") 
        {
			n = n-1;
			div.style.display = "none";
			text.innerHTML = "+ Reservacion aditional / Additional Reservation";
        }
		else 
        {
			if (n < x)
			{
			n = n+1;
            div.style.display = "block";
			text.innerHTML = "- Reservacion aditional / Additional Reservation";
			}
			
		}
    }         
</script>
<body>

<div id="main_wrapper">
    	<div class="main_wrapper_margin">
        	
            <div class="admin_top_menu">
            <!-- #INCLUDE FILE="sales_menu.asp"--> 
           	</div>
        
    		<h1>Prospecto / Prospect: <%=Name%> <%=Surname%></h1>
         	<div class="clear"></div>
            
            <hr/>
<form action="sales-prospect-profile-page-process.asp" type="get" id='prospect_edit'>        
           <div class="todo_column">
  <%if Session("SalesAccessLevel") = 4  then
         
			sqlstring_Sales = "SELECT  * FROM Sales "
		set objConnect_Sales = server.createObject("ADODB.Connection")   
		
		objConnect_Sales.Open conStr

		set TblTemp_Sales = server.createobject("Adodb.Recordset")
		TblTemp_Sales.Open sqlstring_Sales, objConnect_Sales

		%>
          <label>Asignado a / Assigned to: </label>
			<select id="AssignTo" name="AssignTo">
				<option value="">Seleccionar/Select One</option>
				<%
Do Until TblTemp_Sales.EOF
			id = TblTemp_Sales("SaleID")
			LName = TblTemp_Sales("LastName")
			FName = TblTemp_Sales("FirstName")
		   %>
            			<option value="<%=id%>"><%=FName&" "%><%=LName%></option>
			<%
	TblTemp_Sales.MoveNext
	Loop

end if
%>
			</select>

<script type="text/javascript">
	$(document).ready(function(){
		$("#AssignTo").val('<%=SalesId%>');
	});
</script>

           <fieldset>
           	<legend>Informacion Personal/Personal Information</legend>
           	<table cellpadding="0" width="100%">
            	<tr>
				<input type="hidden" id="prospectID" name="prospectID" value="<%=prospectID%>" />
				<td width="33%">
                    <label>Title :</label><br />
                     	<select name="Title" id="Title">
			    		<option value="0" <% if(Trim(Title) = "") then%>selected="selected"<% end if%>>-- Seleccionar --</option>
            			<option value="Mr."<% if(Trim(Title)= "Mr.") then%>selected="selected"<% end if%>>Mr</option>
            			<option value="Miss" <% if(Trim(Title)= "Miss") then%>selected="selected"<% end if%>>Miss</option>
            			<option value="Ms" <% if(Trim(Title)= "Ms") then%>selected="selected"<% end if%>>Ms</option>
                		<option value="Mrs." <% if(Trim(Title)= "Mrs.") then%>selected="selected"<% end if%>>Mrs</option>
            			<option value="Sr." <% if(Trim(Title)= "Sr.") then%>selected="selected"<% end if%>>Sr</option>
            			<option value="Sra."<% if(Trim(Title)= "Sra.") then%>selected="selected"<% end if%>>Sra</option>
            			<option value="Srta."<% if(Trim(Title)= "Srta.") then%>selected="selected"<% end if%>>Srta</option>
            			</select>
            		</td>
				</tr>
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombre/First Name: </label><br />
					<input type="text" name="Fname" id="Fname" value="<%=Name%>"/>
  					</td>
                    <td width="33%">
                    <label>Segundo Nombre/M. Name: </label><br />
                    <input type="text" name="Mname" id="Mname" value="<%=Middle%>"/>
            		</td>
                    <td width="33%">
                    <label>Apellido/Last Name: </label><br />
					<input type="text" name="Lname" id="Lname" value="<%=Surname%>"/>
                    </td>
                </tr><!-- END ROW -->
                 <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Telefono/Phone: </label><br />
					<input type="text" name="phone" id="phone" value="<%=Phone%>"/>
  					</td>
                    <td width="33%">
                    <label>E-mail: </label><br />
					<input type="text" name="email" id="email" value="<%=Email%>"/>
            		</td>
                    <td width="33%">
                    		<label>Idioma/Lenguage: </label><br />
            			<select name="language" id="language" name="language">
	            		<option value="0">Seleccionar/Select One</option>
            			<option value="1">Español</option>
                		<option value="2">English</option>
            			</select>
                    
                    </td>
                </tr><!-- END ROW -->
                
                  <tr> <!-- ROW -->
                    <td>
            	<label>Direccion 1/Address 1: </label><br />
                <input type="text" name="Address1" id="Address1" value="<%=Address1%>"/>
            		</td>
                    <td>
            	<label>Direccion 2/Address 2: </label><br />
                <input type="text" name="Address2" id="Address2" value="<%=Address2%>"/>
            		</td>
                    <td>
             <label>Ciudad/City: </label><br />
                <input type="text" name="City" id="City" value="<%=City%>"/>
            		</td>
                 </tr><!-- END ROW -->
				 
				 <tr> <!-- ROW -->
			    <%
			sqlstring_Country = "SELECT  * FROM Country "
		set objConnect_Country = server.createObject("ADODB.Connection")   
		
		objConnect_Country.Open conStr

		set TblTemp_Country = server.createobject("Adodb.Recordset")
		TblTemp_Country.Open sqlstring_Country, objConnect_Country

		%>
			    <td>
				<label>Pais: </label><br />
					<select id="Pais">
					<option value="0">Seleccionar/Select One</option>
					<%
						Do Until TblTemp_Country.EOF
						id = TblTemp_Country("CountryID")
						Name = TblTemp_Country("CountryName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Country.MoveNext
						Loop
					%>
            	</td>
                    <td>
            	<label>Estado / Provincia: </label><br />
				 <select id="State">
                  <option value='select' selected="selected">Seleccione Estado</option>
                </select>
            		</td>
				</tr>
					<tr>
					<td id="td_pais" style="display:none">
					<label>Country: </label><br />
					 <input type="text" name="Pais" id="country" value=""/>
					</td>
					<td id="td_province" style="display:none">
					<label>Estado / Provincia: </label><br />
					 <input type="text" name="Stado" id="province" value=""/>
					</td>
                    <td>
            	<label>C.P ./ Zip: </label><br />
                <input type="text" name="Zip" id="Zip" value="<%=ZipCode%>"/>
            		</td>
                 </tr><!-- END ROW -->
                    
                <tr> <!-- ROW -->
                    <td>
                  		<label>Comunicasion/Communication: </label><br />
            			<select name="Communication" id="Communication">
            			<option value="">Seleccionar/Select One</option>
            			<option value="Telefono">Telefono</option>
                		<option value="E-Mail">E-Mail</option>
            			</select>
            		</td>
                    <td>
            <label>Fuente / Source: </label><br />
            			<select name="Source" id="Source" >
			    		<option value="">Seleccionar/Select One</option>
            			<option value="Golf Course">Golf Course</option>
                		<option value="Hotel">Hotel</option>
                        <option value="Beach">Beach</option>
                		<option value="Restaurant">Restaurant</option>
                        <option value="La Paz">La Paz</option>
                		<option value="Colgey">Colgey</option>
                        </select>
                    </td>
                 </tr><!-- END ROW -->
           
            </table>
            
           </fieldset>
          <fieldset><!-- Add new profile -->
           		<legend>Profile Detail</legend>
				<table cellpadding="0" width="100%">  
              <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Marital Status: </label><br />
					<input name="Marital" type="radio" value="Yes" /> 
                    Yes<br />
                     <input name="Marital" type="radio" value="No" />
                     No<br />
					</td>
                    <td width="33%">
            		<label>Own a boat: </label><br />
					<input name="boat" type="radio" value="Yes" /> 
                    Yes<br />
                     <input name="boat" type="radio" value="No" />
                     No<br />
					</td>
                    
                 <td width="33%">
                             <label>Feet: </label><br />
				<input type="text" name="feet" id="feet" value="<%=Feet%>"/>
                    </td>
                    </tr>
           
              
           <tr> <!-- ROW -->
                  <td width="33%">
            		<label>Play Golf: </label><br />
					<input name="golf" type="radio" value="Yes" /> 
                    Yes<br />
                     <input name="golf" type="radio" value="No" />
                     No<br />
					</td>
                    
                    <td>
				<label>Investment Range: </label><br />
					<select id="investment_Range" name="investment_Range">
            			<option value="Unknown">Unknown</option>
            			<option value="115_130">115-130 thousand</option>
                		<option value="500_800">500-800 thousand</option>
                		<option value="81+">81 + thousand</option>
            	</td>
				<td width="33%">
                             <label>Occupation: </label><br />
				<input type="text" name="Occupation" id="Occupation" value="<%=Occupation%>"/>
                    </td>
					</tr>
				<tr>
                     <td>
                      <label>Kind of investment: </label><br />
						<select id="kindOfInvestment" name="kindOfInvestment">
            			<option value="Unknown">Unknown</option>
						<option value="lots">Lots</option>
                		<option value="townHome">Town Homes</option>
                		<option value="condos">Condos</option>
                		<option value="fractional">Fractional</option>
                    </td>
					
					<td>
                      <label>Annual Income: </label><br />
					<select id="Annual_Income" name="Annual_Income">
						<option value="Unknown">Unknown</option>
            			<option value="100_250">100 - 250 thousand</option>
                		<option value="251_350">251-350 thousand</option>
                		<option value="350+">350+ thousand</option>
                    </td>

                </tr><!-- END ROW --> 
				<tr> <!-- ROW -->

                    <td width="33%">&nbsp;
                    
                    </td>
                </tr><!-- END ROW -->
           </table>
			</fieldset>      

			
          
          <!-- SECOND PART OF THE FORM -->           
           <fieldset>
           		<legend>Calendario de Visita/Visit Calendar</legend>
                  <table cellpadding="0" width="100%">
                  
                    <tr> <!-- ROW -->
                	<td width="33%" valign="top">
            		<label>Propiedad/Property :</label><br />
                    <input name="Property" type="radio" value="VM" class="properties"/> 
                    VM<br />
                     <input name="Property" type="radio" value="LC" class="properties" />
                     LC<br />
					 <input name="Property" type="radio" value="Home slte" class="properties" /> 
                    Home slte<br />
                     <input name="Property" type="radio" value="Residence Club" class="properties" />
                     Residence Club</td>
                   <td width="33%" valign="top">
             		<label>Interes/Internest :</label><br />
                    <input name="Internest" type="radio" value="Full" /> Full Ownership/Full<br />
                    <input name="Internest" type="radio" value="Fractional" /> Parcial/Fractional
            		</td>
                    <td width="33%" valign="top">
                  	<label>Incentivos/Give Aways :</label><br />
                    <input name="GiveAways" type="checkbox" value="Green Fees" /> Green Fees<br />
                     <input name="GiveAways" type="checkbox" value="Dinner" /> Dinner<br />
                     <input name="GiveAways" type="checkbox" value="Spa Days" /> Spa Days<br />
                     <input name="GiveAways" type="checkbox" value="Meals" /> Meals
                    </td>
                </tr><!-- END ROW -->
                
                <tr> <!-- ROW -->
                <td>        
                  <label>Fecha/Date: </label><br />
					<input type="text" id="Date_VisitCalendar" name = "Date_VisitCalendar" value="<%=Datetime%>"/>
                </td>
                <td>
               <label> Hora/Time:</label><br />
					<input type="text" id="hour" name = "hour" value="5" style="width:20px;min-width:0; text-align:center" /> : <input type="text" style="width:20px;min-width:0; text-align:center" id="minutes" name = "minutes" value="00" />
					<select name="timeday" id="timeday" style="min-width:60px; text-align:center" >
            			<option value="AM">AM</option>
                		<option value="PM">PM</option>
                    </select>
                </td>
<script type="text/javascript">
	$(document).ready(function(){
			// Set Hora Time VisitDetail
		<% if (Hora_time <> "") then %>
		timeVisit = "<%=Hora_time%>";
		var n = timeVisit.split("-");
		$("#hour").val(n[0]);
		$("#minutes").val(n[1]);
		$("#timeday").val($.trim(n[2]));
		<%end if%>

		

		$(":radio[name='Property'][value='<%=Propertis%>']").attr('checked', 'checked');
		$(":radio[name='Internest'][value='<%=Interes%>']").attr('checked', 'checked');
		
		if ('<%=Giveaways%>' != '')
		valueChecks = '<%=Giveaways%>';
		
		var arrChk = valueChecks.split(",");
		
		for (i = 0; i < arrChk.length; i++) {
			$(":checkbox[value='"+ $.trim(arrChk[i]) +"']").prop("checked", "checked");
		}
	});
</script>        
                </tr><!-- END ROW -->
            </table>
				                
           </fieldset>
           <!-- END OF Table -->
 <%
						sqlstring_Products = "SELECT  * FROM Products "
						set objConnect_Products = server.createObject("ADODB.Connection")   
						
						objConnect_Products.Open conStr

						set TblTemp_Products = server.createobject("Adodb.Recordset")
						TblTemp_Products.Open sqlstring_Products, objConnect_Products
					%>         
         <a id="displayText" extra = "0" href="javascript:toggle();" class="" >+ Reservacion aditional / Additional Reservation</a>
          <div id="divA">
<!-- SECOND PART OF THE FORM -->           
           <fieldset>
		   <legend>Stay and Play</legend>		   
			<%
				if (travelsAreals.Count = 0) then
			%>
			<table cellpadding="0" width="100%">
			<input type="hidden" id="travelID_new" name="travelID_new" value="0" />
			<tr> <!-- ROW -->
                	<td width="33%">
            		<label>Originador / Creator:</label><br />
                    <input type="text" name="Creator" id="Creator" />
  					</td>
                    <td width="33%">
                    <label>Producto / Product:</label><br />
                     	<select name="Product" id="Product" >
			    		<option value="">-- Seleccionar --</option>           			
					<%
						Do Until TblTemp_Products.EOF
						id = TblTemp_Products("ProductID")
						Name = TblTemp_Products("ProductName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Products.MoveNext
						Loop
					%>       
						</select>
            		</td>
                    <td width="33%">
                    <label>Campaña / Campaign:</label><br />
					<input type="text" name="Campaign" id="Campaign" />
                    </td>
                </tr><!-- END ROW -->                 
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 1 / Date 1</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival1" name="arrival1" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure1" name="departure1" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
                
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 2 / Date 2</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival2" name="arrival2" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure2" name="departure2" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
            
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Numero de Acompañantes/Extra Guests: </label><br />
                    <select id="Extra_Guests" name="Extra_Guests" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
  					</td>
                    <td width="33%">
                    <label>Numero de Niños / Kids: </label><br />
                    <select id="Kids" name="Kids" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
                    </td>
                    <td width="33%">
                    <label>Noches Extras / Extra Nights: </label><br />
					<select id="Extra_Nights" name="Extra_Nights" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    </select>
                    </td>
                </tr><!-- END ROW -->
                
                 <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombres de Acompañantes / Extras Names: </label><br />
					<textarea cols="15" rows="5" id="Extra_Names" name="Extra_Names" ></textarea>
  					</td>
                    <td width="33%">
                    <label>Detalles de Habitacion / Room Details: </label><br />
					<textarea cols="15" rows="5" id="Room_Details" name="Room_Details" ></textarea>
            		</td>
                    <td width="33%">
                    
                    <label>Actividades / Activities: </label><br />
					<textarea cols="15" rows="5" id="Activities" name="Activities" ></textarea>
              
                    </td>
                </tr><!-- END ROW -->
			</table>
			<%else
		   dim number
		   number = 0
For Each strItem In travelsAreals
number = number + 1

%>  
			<%if (number > 1) then%>
             <tr><td colspan="4"><hr></td></tr>
			<%end if%>
           		<legend>Trip Detail <%=number%></legend>
                  <table cellpadding="0" width="100%">
					<input type="hidden" id="travelID_<%=number%>" name="travelID_<%=number%>" value="<%=travelsAreals(strItem)("9")%>" />
					<input type="hidden" id="codeID_<%=number%>" name="codeID_<%=number%>" value="<%=travelsAreals(strItem)("10")%>" />				  
				<tr> <!-- ROW -->
                	<td width="33%">
            		<label>Originador/Creator:</label><br />
					<input type="text" name="Originador_<%=number%>" id="Originador_<%=number%>" value="<%=travelsAreals(strItem)("0")%>"/>
  					</td>
                    <%					
						set TblTemp_Products1 = server.createobject("Adodb.Recordset")
						TblTemp_Products1.Open sqlstring_Products, objConnect_Products
					%>
                    <td width="33%">
                    <label>Producto / Product:</label><br />
                     	<select name="Product_<%=number%>" id="Product_<%=number%>" >
			    		<option value="0">-- Seleccionar --</option>           			
					<%
						Do Until TblTemp_Products1.EOF
						id = TblTemp_Products1("ProductID")
						Name = TblTemp_Products1("ProductName")
				   %>
						<option value="<%=id%>"<% if(travelsAreals(strItem)("1")= id) then%> selected="selected" <% end if%>><%=Name%></option>
					<%
						TblTemp_Products1.MoveNext
						Loop
					%>       
						</select>
            		</td>
                    <td width="33%">
                    <label>Campaña/Campaing :</label><br />
					<input type="text" name="Campaing_<%=number%>" id="Campaing_<%=number%>" value="<%=travelsAreals(strItem)("2")%>"/>
                    </td>
                </tr><!-- END ROW -->
                  
    <%
	
		Dim x
		x = 0
		sqlstring5 = "SELECT * FROM Reservation WHERE (Status is NULL or Status <> 'anulado') AND TravelId = '"&travelsAreals(strItem)("9")& "'" 
		set TblTemp2 = server.createobject("Adodb.Recordset")
		
		TblTemp2.Open sqlstring5, objConnect
		Do Until TblTemp2.EOF
		x = x + 1
		
			ActualArrival = TblTemp2("ActualArrival")
			ActualDeparture = TblTemp2("ActualDeparture")
		
	%>       
                  
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha <%=x%>/ Date <%=x%></label>
  					</td>
                    <td width="33%">
                    <label>Llegada: </label><br />
                    <input type="text" class="arrival" id="arrival<%=x%>_<%=number%>" name="arrival<%=x%>_<%=number%>" value="<%=ActualArrival%>"/>
					<input type="hidden" id="arrivalOri<%=x%>_<%=number%>" name="arrivalOri<%=x%>_<%=number%>" value="<%=ActualArrival%>"/>
            		</td>
                    <td width="33%">
                    <label>Salida: </label><br />
					<input type="text" class="departure" id="departure<%=x%>_<%=number%>" name ="departure<%=x%>_<%=number%>" value="<%=ActualDeparture%>"/>
					<input type="hidden" id="departureOri<%=x%>_<%=number%>" name ="departureOri<%=x%>_<%=number%>" value="<%=ActualDeparture%>"/>
                    </td>
                </tr><!-- END ROW -->
        <%
			TblTemp2.MoveNext
			Loop
		%>       
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Numero Total de Invitados/ Total guests:</label><br />
                    <select name="NumeroTotaldeInvitados_<%=number%>" id="NumeroTotaldeInvitados_<%=number%>">
                    <%For i = 0 To 5 %>
                    <option value="<%=i%>" <% if(travelsAreals(strItem)("3")= i) then%> selected="selected" <% end if%>><%=i%></option>
					<%Next%>                
                    </select>
  					</td>
                    <td width="33%">
                    <label>Numero de Niños/Kids:</label><br />
                    <select name="NumerodeNinos_<%=number%>" id="NumerodeNinos_<%=number%>">
                    <%For i = 0 To 10 %>
                    <option value="<%=i%>" <% if(travelsAreals(strItem)("4") = i) then%> selected="selected" <% end if%>><%=i%></option>
					<%Next%>                
                    </select>
                    </td>
					<td width="33%" valign="top">
                    <label>Noches Extras/Extra Nights: </label><br />
					<select id="Noches_Extras_<%=number%>" name="Noches_Extras_<%=number%>" >
                    <%For i = 0 To 5 %>
                    <option value="<%=i%>" <% if(travelsAreals(strItem)("5") = i) then%> selected="selected" <% end if%>><%=i%></option>
					<%Next%> 
                    </select>
                    </td>
				</tr>
				<%
						sqlstring6 = "SELECT ReservationCode FROM Reservation WHERE TravelId = '"&travelsAreals(strItem)("9")&"'" 
						set TblTemp3 = server.createobject("Adodb.Recordset")
		
						TblTemp3.Open sqlstring6, objConnect 
						
						If Not TblTemp3.EOF Then
							reservation = TblTemp3("ReservationCode")
						End if
						
						If (IsNull(reservation) = False) then
					%>
					<td width="33%">
                    <label>Reservation Code: </label><br />
                    <input id="Reservationcode" type="text" disabled="" value="<%=reservation%>" name="Reservationcode">
                    </td>
					<% end if%>
				<tr>
                	<td width="33%">
            		<label>Nombres de Acompañantes / Guests Names:</label><br />
					<textarea cols="15" rows="5" name="NombresdeAcompanantes_<%=number%>" id="NombresdeAcompanantes_<%=number%>"><%=travelsAreals(strItem)("6")%></textarea>
  					</td>
                    <td width="33%">
                    <label>Detalles de Habitacion/ Room Details: </label><br />
					<textarea cols="15" rows="5" name="DetallesdeHabitacion_<%=number%>" id="DetallesdeHabitacion_<%=number%>"><%=travelsAreals(strItem)("7")%></textarea>
            		</td>
                    <td width="33%">
                    
                            <label>Actividades/Activities: </label><br />
					<textarea cols="15" rows="5" name="Actividades_<%=number%>" id="Actividades_<%=number%>"><%=travelsAreals(strItem)("8")%></textarea>
              
                    </td>
                </tr><!-- END ROW -->
            </table>
	  <%Next
	  end if%>    		
                 	
			<a id="displayText" href="javascript:divHideShow('divB');">+ Reservacion aditional</a>
            <br />
			</div>
            <div id="divB">
			
             <hr/>
            <h3>Extra 1</h3>
			<table cellpadding="0" width="100%">
                   <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Originador / Creator:</label><br />
                    <input type="text" name="Creator_divB" id="Creator_divB" />
  					</td>
                    <%
		set TblTemp_Products_Extra1 = server.createobject("Adodb.Recordset")
		TblTemp_Products_Extra1.Open sqlstring_Products, objConnect_Products

		%>
                    <td width="33%">
                    <label>Producto / Product:</label><br />
                     	<select name="Product_divB" id="Product_divB" >
			    		<option value="0">-- Seleccionar --</option>           			
					<%
						Do Until TblTemp_Products_Extra1.EOF
						id = TblTemp_Products_Extra1("ProductID")
						Name = TblTemp_Products_Extra1("ProductName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Products_Extra1.MoveNext
						Loop
					%>       
						</select>
            		</td>
                    <td width="33%">
                    <label>Campaña / Campaign:</label><br />
					<input type="text" name="Campaign_divB" id="Campaign_divB" />
                    </td>
                </tr><!-- END ROW -->
                  
                  
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 1 / Date 1</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival1_divB" name="arrival1_divB" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure1_divB" name="departure1_divB" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
                
        
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 2 / Date 2</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival2_divB" name="arrival2_divB" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure2_divB" name="departure2_divB" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
            
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Numero de Acompañantes/Extra Guests: </label><br />
                    <select id="Extra_Guests_divB" name="Extra_Guests_divB" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
  					</td>
                    <td width="33%">
                    <label>Numero de Niños / Kids: </label><br />
                    <select id="Kids_divB" name="Kids_divB" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
                    </td>
                    <td width="33%">
                    <label>Noches Extras / Extra Nights: </label><br />
					<select id="Extra_Nights_divB" name="Extra_Nights_divB" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    </select>
                    </td>
                </tr><!-- END ROW -->
                
                 <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombres de Acompañantes / Extras Names: </label><br />
					<textarea cols="15" rows="5" id="Extra_Names_divB" name="Extra_Names_divB" ></textarea>
  					</td>
                    <td width="33%">
                    <label>Detalles de Habitacion / Room Details: </label><br />
					<textarea cols="15" rows="5" id="Room_Details_divB" name="Room_Details_divB" ></textarea>
            		</td>
                    <td width="33%">
                    
                    <label>Actividades / Activities: </label><br />
					<textarea cols="15" rows="5" id="Activities_divB" name="Activities_divB" ></textarea>
              
                    </td>
                </tr><!-- END ROW -->                 
            </table>
            
                      <br />
<a id="displayText" href="javascript:divHideShow('divC');">+ Reservacion aditional</a>
            <br />
                        
            </div><!-- END  EXTRA INFO -->
            
            
            
            <div id="divC">
<hr/>
			<h3>Extra 2</h3>

            <table cellpadding="0" width="100%">
                          <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Originador / Creator:</label><br />
                    <input type="text" name="Creator_divC" id="Creator_divC" />
  					</td>
                    <%
		set TblTemp_Products_Extra2 = server.createobject("Adodb.Recordset")
		TblTemp_Products_Extra2.Open sqlstring_Products, objConnect_Products

		%>
                    <td width="33%">
                    <label>Producto / Product:</label><br />
                     	<select name="Product_divC" id="Product_divC" >
			    		<option value="0">-- Seleccionar --</option>           			
					<%
						Do Until TblTemp_Products_Extra2.EOF
						id = TblTemp_Products_Extra2("ProductID")
						Name = TblTemp_Products_Extra2("ProductName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Products_Extra2.MoveNext
						Loop
					%>       
						</select>
            		</td>
                    <td width="33%">
                    <label>Campaña / Campaign:</label><br />
					<input type="text" name="Campaign_divC" id="Campaign_divC" />
                    </td>
                </tr><!-- END ROW -->
                  
                  
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 1 / Date 1</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival1_divC" name="arrival1_divC" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure1_divC" name="departure1_divC" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
                
        
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 2 / Date 2</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival2_divC" name="arrival2_divC" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure2_divC" name="departure2_divC" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
            
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Numero de Acompañantes/Extra Guests: </label><br />
                    <select id="Extra_Guests_divC" name="Extra_Guests_divC" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
  					</td>
                    <td width="33%">
                    <label>Numero de Niños / Kids: </label><br />
                    <select id="Kids_divC" name="Kids_divC" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
                    </td>
                    <td width="33%">
                    <label>Noches Extras / Extra Nights: </label><br />
					<select id="Extra_Nights_divC" name="Extra_Nights_divC" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    </select>
                    </td>
                </tr><!-- END ROW -->
                
                 <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombres de Acompañantes / Extras Names: </label><br />
					<textarea cols="15" rows="5" id="Extra_Names_divC" name="Extra_Names_divC" ></textarea>
  					</td>
                    <td width="33%">
                    <label>Detalles de Habitacion / Room Details: </label><br />
					<textarea cols="15" rows="5" id="Room_Details_divC" name="Room_Details_divC" ></textarea>
            		</td>
                    <td width="33%">
                    
                    <label>Actividades / Activities: </label><br />
					<textarea cols="15" rows="5" id="Activities_divC" name="Activities_divC" ></textarea>
              
                    </td>
                </tr><!-- END ROW -->    
             
            </table>
           
                                  <br />
<a id="displayText" href="javascript:divHideShow('divD');">+ Reservacion aditional</a>
            <br />
                        
            
            </div><!-- END  EXTRA INFO -->
            
                      <div id="divD">
<hr/>
		<h3>Extra 3</h3>
		
            <table cellpadding="0" width="100%">
                         <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Originador / Creator:</label><br />
                    <input type="text" name="Creator_divD" id="Creator_divD" />
  					</td>
					<%
		set TblTemp_Products_Extra3 = server.createobject("Adodb.Recordset")
		TblTemp_Products_Extra3.Open sqlstring_Products, objConnect_Products

		%>
                    <td width="33%">
                    <label>Producto / Product:</label><br />
                     	<select name="Product_divD" id="Product_divD" >
			    		<option value="0">-- Seleccionar --</option>           			
					<%
						Do Until TblTemp_Products_Extra3.EOF
						id = TblTemp_Products_Extra3("ProductID")
						Name = TblTemp_Products_Extra3("ProductName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Products_Extra3.MoveNext
						Loop
					%>       
						</select>
            		</td>
                    <td width="33%">
                    <label>Campaña / Campaign:</label><br />
					<input type="text" name="Campaign_divD" id="Campaign_divD" />
                    </td>
                </tr><!-- END ROW -->
                  
                  
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 1 / Date 1</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival1_divD" name="arrival1_divD" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure1_divD" name="departure1_divD" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
                
        
                     <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Fecha 2 / Date 2</label></td>
                    <td width="33%">
                    <label>Llegada / Arrival: </label><br />
                    <input type="text" id="arrival2_divD" name="arrival2_divD" class="datepicker"/>
            		</td>
                    <td width="33%">
                    <label>Salida / Departure: </label><br />
					<input type="text" id="departure2_divD" name="departure2_divD" class="datepicker"/>
                    </td>
                </tr><!-- END ROW -->
            
                <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Numero de Acompañantes/Extra Guests: </label><br />
                    <select id="Extra_Guests_divD" name="Extra_Guests_divD" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
  					</td>
                    <td width="33%">
                    <label>Numero de Niños / Kids: </label><br />
                    <select id="Kids_divD" name="Kids_divD" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
					<option value="10">10</option>
                    <option value="10">10</option>                    
                    </select>
                    </td>
                    <td width="33%">
                    <label>Noches Extras / Extra Nights: </label><br />
					<select id="Extra_Nights_divD" name="Extra_Nights_divD" >
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    </select>
                    </td>
                </tr><!-- END ROW -->
                
                 <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombres de Acompañantes / Extras Names: </label><br />
					<textarea cols="15" rows="5" id="Extra_Names_divD" name="Extra_Names_divD" ></textarea>
  					</td>
                    <td width="33%">
                    <label>Detalles de Habitacion / Room Details: </label><br />
					<textarea cols="15" rows="5" id="Room_Details_divD" name="Room_Details_divD" ></textarea>
            		</td>
                    <td width="33%">
                    
                    <label>Actividades / Activities: </label><br />
					<textarea cols="15" rows="5" id="Activities_divD" name="Activities_divD" ></textarea>
              
                    </td>
                </tr><!-- END ROW -->    
            </table>
          
            
            </div><!-- END  EXTRA INFO -->
				                        
           </fieldset><!-- END OF FADED -->
           
            <fieldset><!-- TRANSPORTACION -->
           		<legend>Transporte/Transportation</legend>
                
           <%
			sqlstring_Airlines = "SELECT  * FROM Airlines "
		set objConnect_Airlines = server.createObject("ADODB.Connection")   
		
		objConnect_Airlines.Open conStr

		set TblTemp_Airlines = server.createobject("Adodb.Recordset")
		TblTemp_Airlines.Open sqlstring_Airlines, objConnect_Airlines

		%>
           <table cellpadding="0" width="100%">     
           <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Aereolinea: </label><br />
					<select name="Aereolinea" id="Aereolinea">
	            		<option value="0">-- Seleccionar --</option>
            			<%
		Do Until TblTemp_Airlines.EOF

			id = TblTemp_Airlines("AirlineID")
			Name = TblTemp_Airlines("AirlineName")
		   %>
            			<option value="<%=id%>"><%=Name%></option>
			<%
	TblTemp_Airlines.MoveNext
	Loop

%>       
                       </select>
                       </td>
			<%
			sqlstring_Airport = "SELECT  * FROM Airports "
		set objConnect_Airport = server.createObject("ADODB.Connection")   
		
		objConnect_Airport.Open conStr

		set TblTemp_Airport = server.createobject("Adodb.Recordset")
		TblTemp_Airport.Open sqlstring_Airport, objConnect_Airport

		%>
                    <td width="33%">
                             <label>Aereopuerto: </label><br />
					<select name="Aereopuerto" id="Aereopuerto">
	            		<option value="0">-- Seleccionar --</option>
						<%
		Do Until TblTemp_Airport.EOF

			id = TblTemp_Airport("AirportID")
			Name = TblTemp_Airport("AirportName")
		   %>
            			<option value="<%=id%>"><%=Name%></option>
			<%
	TblTemp_Airport.MoveNext
	Loop

%>       
            		</select>
                    </td>
                    
                   <td width="33%" valign="top">
                    <label>Necesitan Transporte?/ Need Transport</label><br />
					<select id="Need_Transport" name="Need_Transport" >
	            		<option value="-1">-- Seleccionar --</option>
            			<option value="SI">SI</option>
                		<option value="NO">NO</option>
            		</select>
            		</td>
                </tr><!-- END ROW --> 
                
                 <tr> <!-- ROW -->
                	<td width="33%" valign="top">
            		<label>Hora Aproximada de llegada / Aprox Arrival Time: </label><br />
					<input type="text" name="Aprox_Arrival_Time" name = "Aprox_Arrival_Time"/>
                    
                    
                       </td>
                    <td width="33%">&nbsp;
                  
                    </td>
                    
                   <td width="33%">&nbsp;
                 
            		</td>
                </tr><!-- END ROW --> 
                
                 <tr><!-- ROW -->
                <td colspan="3">
                <label>Notas / Notes: </label><br />
                <textarea cols="50" rows="3" name="Notes" id="Notes"></textarea>
                </td>
                </tr><!-- END ROW -->
                
                <tr><!-- ROW -->
                <td colspan="3">
                <label>Información Pendiente / Pending Info: </label><br />
                <textarea cols="50" rows="3" name="Pending_info" id="Pending_info"></textarea>
                </td>
                </tr><!-- END ROW -->
                
                
                  <tr> <!-- ROW -->
                	
                    <td width="33%">&nbsp;
                    
                    </td>
                </tr><!-- END ROW -->
           
           </table>
           </fieldset><!-- END TRANSPORTACION -->
           
           
            <fieldset><!-- CREDIT CARD -->
           		<legend>Tarjeta de Credito</legend>
                
           <table cellpadding="0" width="100%">  
              <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Nombre: </label><br />
					<input type="text" name="NombreCard" id="NombreCard" />   </td>
                    <td width="33%">
                             <label>Tipo: </label><br />
					<select name="Tipo" id="Tipo">
	            		<option value="">-- Seleccionar --</option>
            			<option value="Visa">Visa</option>
                		<option value="Master Card">Master Card</option>
                        <option value="American Express">American Express</option>
                        <option value="Discover">Discover</option>
                       </select>
                    </td>
                    
                 <td width="33%">
                             <label>Numero de Tarjeta: </label><br />
				<input type="text" name="NumerodeTarjetaCard" id="NumerodeTarjetaCard"/>
                    </td>
                    
                    </tr>
           
              
           <tr> <!-- ROW -->
                  <td width="33%">
                    <label>Fecha de Expiracion (MM/YY)</label><br />
					<input type="text" name="FechaDeExpiracion" id="FechaDeExpiracion"/>
            		</td>
                    
                    <td>
                      <label>Codigo de Seguridad: </label><br />
				<input type="text" name="CodigodeSeguridad" id="CodigodeSeguridad"/>
                    </td>
					</tr>
					<tr></tr>
					<tr></tr>
				<tr>
                     <td>
                      <label>Billing Address: </label>
					</td>
					<td>
						<input type="checkbox" name="addAdress" id="addAdress"/>
						<label>Same as above</label>
                    </td>

                </tr><!-- END ROW --> 
				<tr></tr>
					<tr></tr>
					<tr> <!-- ROW -->
                    <td>
            	<label>Direccion 1: </label><br />
                <input type="text" name="Direccion1_billing" id="Direccion1_billing" value="<%=Address1_CC%>"/>
            		</td>
                    <td>
            	<label>Direccion 2: </label><br />
                <input type="text" name="Direccion2_billing" id="Direccion2_billing" value="<%=Address2_CC%>"/>
            		</td>
                    <td>
             <label>Ciudad: </label><br />
                <input type="text"name="Ciudad_billing" id="Ciudad_billing" value="<%=City_CC%>"/>
            		</td>
                 </tr><!-- END ROW -->
				<tr>
				<%
			sqlstring_Country = "SELECT  * FROM Country "
		set objConnect_Country = server.createObject("ADODB.Connection")   
		
		objConnect_Country.Open conStr

		set TblTemp_Country = server.createobject("Adodb.Recordset")
		TblTemp_Country.Open sqlstring_Country, objConnect_Country

		%>
			    <td>
				<label>Pais: </label><br />
					<select id="Pais_billing">
					<option value="0">Seleccionar/Select One</option>
					<%
						Do Until TblTemp_Country.EOF
						id = TblTemp_Country("CountryID")
						Name = TblTemp_Country("CountryName")
				   %>
						<option value="<%=id%>"><%=Name%></option>
					<%
						TblTemp_Country.MoveNext
						Loop
					%>
            	</td>
                    <td>
            	<label>Estado / Provincia: </label><br />
				 <select id="State_billing">
                  <option value='select' selected="selected">Seleccione Estado</option>
                  
                </select>
            		</td>
				</tr>
					<tr>
					<td id="td_pais_billing" style="display:none">
					<label>Country: </label><br />
					 <input type="text" name="Pais_billing" id="country_billing" value="<%=Country_CC%>"/>
					</td>
					<td id="td_province_billing" style="display:none">
					<label>Estado / Provincia: </label><br />
					 <input type="text" name="Stado_billing" id="province_billing" value="<%=Province_CC%>"/>
					</td>
                    <td>
            	<label>Codigo Postal: </label><br />
                <input type="text"name="Postal_billing" id="Postal_billing" value="<%=ZipCode_CC%>"/>
            		</td>
                   
                 </tr><!-- END ROW -->
				</tr>
				
				<tr> <!-- ROW -->

                    <td width="33%">&nbsp;
                    
                    </td>
                </tr><!-- END ROW -->
				
           </table>
           </fieldset><!-- END CREDIT CARD -->
		   		 <div id="button_submit" style="text-align:center">
                    <br />
                    <input type="button"  value="Guardar / Save" onclick='SubmitForm()'/>
            		</div>
					  
</form>		
           
          	</div><!-- END .todo_column -->
            <div class="timeline_column">
            <div class="profile_top_right">
 			<h2>Historia de Huesped</h2>
            <ul class="guest_timeline_list">
   <%
		sqlstring4 = "SELECT  * FROM HistoryProspect WHERE GuestID = "&prospectID&" ORDER BY Date DESC "
		set objConnect4 = server.createObject("ADODB.Connection")   

		objConnect4.Open conStr

		set TblTemp4 = server.createobject("Adodb.Recordset")
			
			TblTemp4.Open sqlstring4, objConnect4
			
		Do Until TblTemp4.EOF
			
			idHistory = TblTemp4("HistoryID")
			DateOfHistory = TblTemp4("Date")
			Schedule_date = TblTemp4("ScheduleDate")
			NameOfHistory = TblTemp4("Name")
			IsNote = TblTemp4("IsNote")
			ShId = TblTemp4("ScheduleCallId")
			If (IsNote = true) then
				IsNote = 1
			else 
				IsNote = 0
			end if
	%>
			<%if (IsNull(DateOfHistory) = False) then%>
				<%if (NameOfHistory = "Sent Email") THEN%>	
					<li><a href="#" id="<%=idHistory&"_"&IsNote%>"><%=NameOfHistory%></a> <span><%=FormatDateTime(DateOfHistory,2)%></span></li>
				<%elseif (NameOfHistory = "Call scheduled") THEN %>
					<li><a href="sales-call-update-reschedule.asp?shID=<%=ShId%>" id="<%=idHistory&"_"&IsNote%>" target="_blank"><%=NameOfHistory%></a> <span><%=FormatDateTime(Schedule_date,2)%></span></li>
				<%elseif (NameOfHistory = "Call ReSchedule") THEN%>
					<li><a href="sales-call-update-reschedule.asp?shID=<%=ShId%>" id="<%=idHistory&"_"&IsNote%>" target="_blank"><%=NameOfHistory%></a> <span><%=FormatDateTime(Schedule_date,2)%></span></li>
				<%else%>
					<li><a href="#" id="<%=idHistory&"_"&IsNote%>" class="linkHistory"><%=NameOfHistory%></a> <span><%=FormatDateTime(DateOfHistory,2)%></span></li>
				<%end if%>
			<%end if%>
     <%
	TblTemp4.MoveNext
	Loop

%>       
            </ul>
            
            
            </div><!-- profile_top_right -->
            
           <div class="profile_bottom_right">
            <h2>Ingresar Nota Nueva</h2>
            <form action="addnewNotes" method="get">
            <label>Titulo:</label><br />
            <input type="text" id="Titulo" name="Titulo"/><br />
            <label>Nota:</label><br />
            <textarea cols="18" rows="5" id="Nota" name="Nota"></textarea><br />
			<input type="hidden" id="guestID" name="guestID" value="<%=prospectID%>" />
            <input type="button"  value="Enviar" id="addNotes"/>        
            </form>
			
            </div><!-- .profile_bottom_right -->
			
			
			<h3><a href="sales-call-schedule.asp?pID=<%=prospectID%>">Programar Llamada/Schedule Call</a></h3>
			
			<h3><a href="send-email.asp?pID=<%=prospectID%>">Enviar Email/Send Email</a></h3>
            
			
			</div> <!-- END .timeline_column -->
            
            <div class="clear"></div>    
    
    	</div><!-- END .main_wrapper_margin -->

					   </div>  
					  
	<!-- END #main_wrapper -->

               <!-- FOOTER -->
         
         <!--#INCLUDE file="sales_footer.asp"-->
         
         <!-- END FOOTER -->  
<script type="text/javascript">
	$(function() {
		if($("#arrival1_1"))
			$( "#arrival1_1" ).datepicker();
		if($("#departure1_1"))
			$( "#departure1_1" ).datepicker();
		if($("#arrival2_1"))
			$( "#arrival2_1" ).datepicker();
		if($("#departure2_1"))
			$( "#departure2_1" ).datepicker();
			
		if($("#arrival1_2"))
			$( "#arrival1_2" ).datepicker();
		if($("#departure1_2"))
			$( "#departure1_2" ).datepicker();
		if($("#arrival2_2"))
			$( "#arrival2_2" ).datepicker();
		if($("#departure2_2"))
			$( "#departure2_2" ).datepicker();
			
		if($("#arrival1_3"))
			$( "#arrival1_3" ).datepicker();
		if($("#departure1_3"))
			$( "#departure1_3" ).datepicker();
		if($("#arrival2_3"))
			$( "#arrival2_3" ).datepicker();
		if($("#departure2_3"))
			$( "#departure2_3" ).datepicker();
			
		if($("#arrival1_4"))
			$( "#arrival1_4" ).datepicker();
		if($("#departure1_4"))
			$( "#departure1_4" ).datepicker();
		if($("#arrival2_4"))
			$( "#arrival2_4" ).datepicker();
		if($("#departure2_4"))
			$( "#departure2_4" ).datepicker();
			
		// Set value for profile
		$(":radio[name='Marital'][value='<%=MaritalStatus%>']").attr('checked', 'checked');
		$(":radio[name='boat'][value='<%=OwnABoat%>']").attr('checked', 'checked');
		$(":radio[name='golf'][value='<%=PlayGolf%>']").attr('checked', 'checked');
		$("#investment_Range").val('<%=InvestmentRange%>');
		$("#kindOfInvestment").val('<%=KindOfInvestment%>');
		$("#Annual_Income").val('<%=AnnualIncome%>');
			
					
		// datepicker divA
		$( "#arrival1_divB" ).datepicker();
		$( "#arrival2_divB" ).datepicker();
		$( "#departure1_divB" ).datepicker();
		$( "#departure2_divB" ).datepicker();
		
		// datepicker divB
		$( "#arrival1_divC" ).datepicker();
		$( "#departure1_divC" ).datepicker();
		$( "#departure2_divC" ).datepicker();
		$( "#arrival2_divC" ).datepicker();
		
		// datepicker divC
		$( "#arrival1_divD" ).datepicker();
		$( "#departure1_divD" ).datepicker();
		$( "#departure2_divD" ).datepicker();
		$( "#arrival2_divD" ).datepicker();
	});
	</script>
</body>
</html>
